<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Spring Boot 数据库国际化示例</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            line-height: 1.6;
        }
        h1 {
            color: #333;
            text-align: center;
        }
        .container {
            background-color: #f5f5f5;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .message {
            margin: 20px 0;
            padding: 15px;
            background-color: #fff;
            border-radius: 4px;
        }
        .database-info {
            margin: 15px 0;
            padding: 10px;
            background-color: #d4edda;
            color: #155724;
            border-radius: 4px;
            font-size: 0.9em;
            border-left: 4px solid #28a745;
        }
        .language-switch {
            margin: 20px 0;
            padding: 15px;
            background-color: #e9ecef;
            border-radius: 4px;
            text-align: center;
        }
        .language-switch a {
            display: inline-block;
            margin: 0 10px;
            padding: 8px 15px;
            background-color: #007bff;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            transition: background-color 0.3s;
        }
        .language-switch a:hover {
            background-color: #0056b3;
        }
        .api-info {
            margin-top: 30px;
            padding: 20px;
            background-color: #e3f2fd;
            border-radius: 8px;
        }
        pre {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 4px;
            overflow-x: auto;
        }
        code {
            font-family: 'Courier New', monospace;
        }
    </style>
</head>
<body>
    <h1 th:text="#{welcome}"></h1>
    
    <div class="container">
        <div class="message">
            <h2 th:text="#{greeting.message('访客')}"></h2>
            <p th:text="#{current.language(${#locale.language})}"></p>
            <div class="database-info">
                <strong>提示：</strong> 这些国际化消息当前从数据库中读取，支持实时更新无需重启应用。
            </div>
        </div>
        
        <div class="language-switch">
            <h3 th:text="#{change.language}"></h3>
            <a href="?lang=zh_CN">中文</a>
            <a href="?lang=en_US">English</a>
        </div>
        
        <div class="api-info">
            <h3>API 接口信息</h3>
            <p>以下是可用的国际化相关API接口：</p>
            
            <div>
                <h4>获取数据库中的国际化消息</h4>
                <pre><code>GET /i18n/message?lang=[language_code]</code></pre>
                <p>示例：</p>
                <ul>
                    <li><a href="/i18n/message?lang=zh_CN">中文消息</a></li>
                    <li><a href="/i18n/message?lang=en_US">English Messages</a></li>
                </ul>
            </div>
            
            <div>
                <h4>获取数据库中支持的语言</h4>
                <pre><code>GET /i18n/languages</code></pre>
                <a href="/i18n/languages">查看支持的语言</a>
            </div>
        </div>
    </div>
</body>
</html>